IF OBJECT_ID('dbo.vwInfoEdProposals') IS NOT NULL
BEGIN
    DROP VIEW dbo.vwInfoEdProposals
    IF OBJECT_ID('dbo.vwInfoEdProposals') IS NOT NULL
        PRINT '<<< FAILED DROPPING VIEW dbo.vwInfoEdProposals >>>'
    ELSE
        PRINT '<<< DROPPED VIEW dbo.vwInfoEdProposals >>>'
END
go
-- =======================================================================
-- Object Name: (VIEW) dbo.vwInfoEdProposals
--
-- Author:      Kevin Cashman, Parallax Consulting LLC
--
-- Create date: 8/13/2007
--
-- Description: View to get Proposal data from InfoEd table 
--
-- Used BY Procedure/Report: CSCR Reports
--
--------------------------------------------------------------------------
-- Date        Initials  Modification
--------------------------------------------------------------------------
-- 8/13/07     KC        Created
-- 9/11/07     KC        Fixed Joins
-- 10/16/07    KC        Added TransactionType
-- 04/11/07    KC        Added PO.prop_type
-- 04/16/08    KC        Simplified joins, dropped fields.
--
-- =======================================================================
CREATE VIEW dbo.vwInfoEdProposals
AS
SELECT   DISTINCT PO.inst_no,
          PO.prop_no,
          PO.prop_stat AS prop_bud_stat,
          PO.prop_stat_dt AS PropBudStatDate,
          PS.prop_stat AS prop_stat,
          PS.stat_type,
          PS.stat_date AS PropStatDate,
          PS.effectivedt AS PropStatEffDate,
          PO.instrum,
          PO.prop_type,
          PO.ParentProp_no,
          PO.submt_dt,
          PO.short_title,
          PO.proj_title
FROM      dbo.InfoEdProposal PO LEFT OUTER JOIN dbo.InfoEdPropStat PS ON PO.prop_no = PS.prop_no 
               AND PO.inst_code = PS.inst_code 
WHERE     PO.inst_code = 'PARTNERS'

     
go
IF OBJECT_ID('dbo.vwInfoEdProposals') IS NOT NULL
    PRINT '<<< CREATED VIEW dbo.vwInfoEdProposals >>>'
ELSE
    PRINT '<<< FAILED CREATING VIEW dbo.vwInfoEdProposals >>>'
go
